import {baseImgUrl} from './index'

let testApiUrl = baseImgUrl;

export const getHosImg = function(imgO,size,id){
   var img = imgO,
       img_point = img.indexOf('.'),
       img_src = testApiUrl + "hospital/" + id + "/" + img.substring(0,img_point) + size + img.substring(img_point);
   return img_src;
 };
export const getDocImg = function(imgO,size,hosId,docId){
   var img = !!imgO?imgO:'',
       img_point = img?img.indexOf('.'):'',
       img_src = testApiUrl+"hospital/" + hosId + "/doctor/" + docId + '/' + img.substring(0,img_point) + size + img.substring(img_point);
   return img_src;
 };
export const getServImg = function(imgO,size,hosId,itemId){
    var img = imgO,
        img_point = img.indexOf('.'),
        img_src = testApiUrl +"hospital/" + hosId + "/item/" + itemId + '/' + img.substring(0,img_point) + size + img.substring(img_point);
    return img_src;
  };
export const getCaseImg = function(imgO,size,hosId,itemId){
   var img = imgO,
       img_point = img.indexOf('.'),
       img_src = testApiUrl +"case/" + hosId + "/" + itemId + "/"  + img.substring(0,img_point) + size + img.substring(img_point);
   return img_src;
};
export const getArtImg = function(imgO,size){
  var img = imgO,
      img_point = img.indexOf('.'),
      img_src = testApiUrl +"article/" + img.substring(0,img_point) + size + img.substring(img_point);
  return img_src;
};